package com.battle.service.controller.web;

import com.battle.pojo.param.caseAlarmPanel.*;
import com.battle.pojo.vo.caseAlarmPanel.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
*   web/接处警-战例信息
* 【描 述】：
* 【环 境】：J2SE
* 【详 细】：
*
*/
@RestController
@RequestMapping("/caseAlarmPanel/web")
public class CaseAlarmPanelWebController {

private final CaseAlarmPanelService service;

public CaseAlarmPanelWebController(CaseAlarmPanelService service) {
this.service = service;
}


/**
* 创建接处警-战例信息
* @param param
* @return
*/
@PostMapping("/createCaseAlarmPanel")
public ApiResult createCaseAlarmPanel(@RequestBody @Valid CreateCaseAlarmPanelParam param){
service.createCaseAlarmPanel(param);
return ApiResult.ok();
}


/**
* 修改接处警-战例信息
* @param param
*/
@PutMapping("/editCaseAlarmPanel")
public ApiResult editCaseAlarmPanel(@RequestBody @Valid EditCaseAlarmPanelParam param){
service.editCaseAlarmPanel(param);
return ApiResult.ok();
}

/**
* 移除接处警-战例信息
* @param id
*/
@DeleteMapping("/removeCaseAlarmPanel")
public ApiResult removeCaseAlarmPanel(@RequestParam("id") Long id){
service.removeCaseAlarmPanel(id);
return ApiResult.ok();
}

/**
* 启动/禁用接处警-战例信息
* @param id
*/
@GetMapping("/enabledCaseAlarmPanel")
public ApiResult enabledCaseAlarmPanel(@RequestParam("id") Long id){
service.enabledCaseAlarmPanel(id);
return ApiResult.ok();
}

/**
* 获取接处警-战例信息详情
* @param id
* @return
*/
@GetMapping("/getCaseAlarmPanel")
public ApiResult< GetCaseAlarmPanelVo> getCaseAlarmPanel(@RequestParam("id") Long id){
GetCaseAlarmPanelVo vo = service.getCaseAlarmPanel(id);
return ApiResult.ok(vo);
}

/**
* 获取接处警-战例信息列表
* @param param
* @return
*/
@PostMapping("/getCaseAlarmPanelList")
public ApiResult< PageResult< GetCaseAlarmPanelListVo>> getCaseAlarmPanelList(@RequestBody GetCaseAlarmPanelListParam param){
PageResult< GetCaseAlarmPanelListVo> result = service.getCaseAlarmPanelList(param);
return ApiResult.ok(result);
}


/**
* 获取接处警-战例信息下拉列表
*
* @return
*/
@PostMapping("/getCaseAlarmPanelDownList")
public ApiResult< List< GetCaseAlarmPanelDownListVo > > getCaseAlarmPanelDownList(@RequestBody(required = false) @Valid GetCaseAlarmPanelDownListParam param) {
List< GetCaseAlarmPanelDownListVo > list = service.getCaseAlarmPanelDownList(param);
return ApiResult.ok(list);
}


}

